package touro.mancala.client;

import java.awt.Color;
import java.util.ArrayList;
import java.util.Random;

public class RandomStrategy {
	
	private int StoneCount=48;
	
	public Board getRandomBoard(){
		Player[] p={new Player("random1") ,new Player( "random2")};
		Board b=new Board(p,Color.RED);
		
		for(int i=0;i<=14;i++){
			if(i==14){
				ArrayList<Stone> stones=new ArrayList<Stone>(StoneCount);
				b.getStore(i).setStones(stones);
			}
			else{
			ArrayList<Stone> stones=new ArrayList<Stone>(getRandomNumber());
			b.getStore(i).setStones(stones);
			}
		}
		
		return b;	
	}
	private int getRandomNumber(){
		Random r=new Random();
		int answer=r.nextInt(StoneCount);
		StoneCount-=answer;
		return answer;
	}
}
